package com.atstudy.arrays;

import java.util.Arrays;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2022/12/20 16:12
 * @copyright: 博为峰
 */
public class ArraysDemo {
    public static void main(String[] args) {
        int[] arr = new int[]{6, 9, 3, 10, 12, 1};
        //排序（正序） 1 3 6 9 10 12
//        Arrays.sort(arr);
        //二分查找（有序）
        int search = Arrays.binarySearch(arr, 99);
//        System.out.println(search);

        //复制
        int[] copy = Arrays.copyOf(arr, 10);

        System.out.println(Arrays.toString(copy));
    }
}
